﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;
using l1cs.server.model.gametime;

namespace l1cs.server.serverpackets
{
    public class S_GameTime : ServerBasePacket
    {
        public S_GameTime( int time )
        {
            buildPacket( time );
        }

        public S_GameTime()
        {
            int time = (int)L1GameTimeClock.getInstance().currentTime().getSeconds();
            buildPacket( time );
        }

        private void buildPacket( int time )
        {
            writeC( Opcodes.S_OPCODE_GAMETIME );
            writeD( time );
        }

        override
        public byte[] getContent()
        {
            return getBytes();
        }

        override public String getType()
        {
            return "[S] S_GameTime";
        }
    }
}